package cn.funnyxb.powerremember.pullMsg;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.AsyncTask;
import cn.funnyxb.powerremember.pullMsg.beans.AppConfig;
import cn.funnyxb.tools.appFrame.App;
import cn.funnyxb.tools.appFrame.activityFrame.AbstractProccessor;
import cn.funnyxb.tools.appFrame.debugTool.Debuger;

public class PullTask4AppConfig extends AsyncTask<Void, Void, AppConfig>
{
  private Context context;
  private AbstractProccessor proccessor;

  public PullTask4AppConfig(Context paramContext, AbstractProccessor paramAbstractProccessor)
  {
    this.context = paramContext;
    this.proccessor = paramAbstractProccessor;
  }

  private void log(String paramString)
  {
    Debuger.log("pullAppConfig", paramString);
  }

  private void notifyAppConfig(AppConfig paramAppConfig)
  {
    log("appconfig=" + paramAppConfig);
    App.getApp().setAppConfig(paramAppConfig);
  }

  private void turn2PullVersionMsg()
  {
    new PullTask4Version(this.context, this.proccessor).execute(new Void[0]);
  }

  protected AppConfig doInBackground(Void[] paramArrayOfVoid)
  {
    this.proccessor.regAsyncTask(this);
    AppConfig localAppConfig = new ServerMsger(this.context).getAppConfig();
    log("appConfig=" + localAppConfig);
    return localAppConfig;
  }

  protected void onPostExecute(AppConfig paramAppConfig)
  {
    super.onPostExecute(paramAppConfig);
    if (paramAppConfig == null)
      turn2PullVersionMsg();
    while (true)
    {
      return;
      try
      {
        if (paramAppConfig.getVersionCode() > this.context.getPackageManager().getPackageInfo(this.context.getPackageName(), 1).versionCode);
        notifyAppConfig(paramAppConfig);
        if (paramAppConfig.isValid())
          turn2PullVersionMsg();
      }
      catch (PackageManager.NameNotFoundException localNameNotFoundException)
      {
        turn2PullVersionMsg();
      }
      finally
      {
        this.proccessor.unRegAsyncTask(this);
      }
    }
  }
}

/* Location:           E:\Desktop\复件 classes_dex2jar.jar
 * Qualified Name:     cn.funnyxb.powerremember.pullMsg.PullTask4AppConfig
 * JD-Core Version:    0.5.3
 */